/**
 * 
 */
package com.zte.claa.inficombo.csa.app.service.rptparse;



import java.util.ArrayList;
import java.util.List;



/**
 * @author 0283000115
 * 
 * 克拉融合定位终端的原始定位数据.
 */
public class LocRawData {
	// 初始化命令已在终端起效.
	public static final int IS_CONF_ACTIVED = 1;
	public static final int IS_CONF_INACTIVED = 0;
	public static final int IS_CONF_INVALID = -1;
	
	// 融合终端对应的原始定位数据表-表名.
	public static final String GSP_DATA_TABLE = "lcs_dev_gps_record_table";
	public static final String LORA_TERMINAL_DATA_TABLE = "lcs_loraterminal_data_process_table";
	public static final String BT_ANCHOR_DATA_TABLE = "lcs_bt_lct_process_table";
	public static final String BT_BEACON_DATA_TABLE = "lcs_bt_beacon_process_table";
	//gps搜星详情
	public static final String GPS_DETAIL_TABLE = "lcs_dev_gps_detail_table";
	// 诊断测试数据.
	public static final String GSP_DATA_TABLE_TEST = "lcs_dev_gps_record_table_test";
	// mems震动数据.
	public static final String MEMS_STATE_DATA_TABLE = "lcs_dev_mems_state";
	//电量管理数据
	public static final String DEVICE_POWER_DATA= "t_combo_devpower_data";	
	//deveui与gw之间信号强度数据
	public static final String DEVICE_GW_STATE_TABLE = "lcs_dev_gw_state_table";
	
	
	// 融合定位终端可能上报的四类原始数据.
	private List<String> gpsJsonDatas = null;
	private List<String> loraTerminalJsonDatas = null;
	private List<String> anchorJsonDatas = null;
	private List<String> beaconJsonDatas = null;	
	//gps搜星详情
	private List<String> gpsDetailJsonData = null;
	//lora信标数据
	private List<String> loraBeaconDatas = null;
	//mems字段解析...
	private List<String> memsStateJsonData = null;	
	//gw与终端的detail数据
	private List<String> loraRssiData = null;
	//终端电量管理数据
	private List<String> devPowerData = null;	
	//标签电量管理数据
	private List<String> labelPowerData = null;	
	//deveui与gw之间信号强度数据
	private List<String> deveuiGwStateData = null;
	// uwb数据
	private List<String> uwbJsonData = null;
	// CMNB-Anchor 上报的自身定位数据（json格式）.
	private List<String> cmNbAnchorGpsData = null;
	
	// 1--已经起效; 0--未起效； -1表示未做设置（不需要更新数据库）
	private int actived = IS_CONF_INVALID;
	
	public LocRawData(){
		this.gpsJsonDatas = new ArrayList<>(0);
		this.loraTerminalJsonDatas = new ArrayList<>(0);
		this.anchorJsonDatas = new ArrayList<>(0);
		this.beaconJsonDatas = new ArrayList<>(0);
		this.gpsDetailJsonData = new ArrayList<>(0);
		this.loraBeaconDatas = new ArrayList<>(0);
		this.memsStateJsonData = new ArrayList<>(0);
		this.loraRssiData = new ArrayList<>(0);
		this.devPowerData = new ArrayList<>(0);
		this.labelPowerData = new ArrayList<>(0);
		this.deveuiGwStateData = new ArrayList<>(0);
		this.uwbJsonData = new ArrayList<>(0);
		this.cmNbAnchorGpsData = new ArrayList<String>(0);
	}
	
	
	public void addLoraRssiData(String jsonData){
		this.loraRssiData.add(jsonData);
	}
	
	public List<String> getLoraRssiData() {
		return loraRssiData;
	}
	
	public void addLoraBeaconData(String jsonData){
		this.loraBeaconDatas.add(jsonData);
	}
	
	public List<String> getLoraBeaconData() {
		return loraBeaconDatas;
	}
		
	public void addGpsDetailData(String jsonData) {
		this.gpsDetailJsonData.add(jsonData);
	}
	
	public void addGpsData(String jsonData){
		this.gpsJsonDatas.add(jsonData);
	}
	
	public void addLoraTerminalData(String jsonData){
		this.loraTerminalJsonDatas.add(jsonData);
	}
	
	public void addBtAnchorData(String jsonData){
		this.anchorJsonDatas.add(jsonData);
	}
	
	public void addBtBeaconData(String jsonData){
		this.beaconJsonDatas.add(jsonData);
	}

	
	public void addUwbJsonData(String jsonData){
		this.uwbJsonData.add(jsonData);
	}
	
	public List<String> getUwbJsonData() {
		return uwbJsonData;
	}

	public void setUwbJsonData(List<String> uwbJsonData) {
		this.uwbJsonData = uwbJsonData;
	}
	
	public List<String> getGpsJsonDatas() {
		return gpsJsonDatas;
	}

	public List<String> getLoraTerminalJsonDatas() {
		return loraTerminalJsonDatas;
	}

	public List<String> getAnchorJsonDatas() {
		return anchorJsonDatas;
	}

	public List<String> getBeaconJsonDatas() {
		return beaconJsonDatas;
	}
	
	public List<String> getGpsDetailJsonData() {
		return gpsDetailJsonData;
	}
	
	public List<String> getMemsStateJsonData() {
		return memsStateJsonData;
	}

	public void setMemsStateJsonData(List<String> memsStateJsonData) {
		this.memsStateJsonData = memsStateJsonData;
	}
	
	public void addMemsStateJsonData(String memsStateJsonData) {
		this.memsStateJsonData.add(memsStateJsonData);
	}
	
	public List<String> getDevPowerData() {
		return devPowerData;
	}

	public void setDevPowerData(List<String> devPowerData) {
		this.devPowerData = devPowerData;
	}
	
	public void addDevPowerData(String devPowerData) {
		this.devPowerData.add(devPowerData);
	}
	
	public List<String> getDeveuiGwStateData() {
		return deveuiGwStateData;
	}

	public void setDeveuiGwStateData(List<String> deveuiGwStateData) {
		this.deveuiGwStateData = deveuiGwStateData;
	}
	
	public void addDeveuiGwStateData(String deveuiGwStateData) {
		this.deveuiGwStateData.add(deveuiGwStateData);
	}
		
	public List<String> getLabelPowerData() {
		return labelPowerData;
	}

	public void setLabelPowerData(List<String> labelPowerData) {
		this.labelPowerData = labelPowerData;
	}

	public void addLabelPowerData(String labelPowerData) {
		this.labelPowerData.add(labelPowerData);
	}
	
	public List<String> getCmNbAnchorGpsData() {
		return cmNbAnchorGpsData;
	}

	public void setCmNbAnchorGpsData(List<String> cmNbAnchorGpsData) {
		this.cmNbAnchorGpsData = cmNbAnchorGpsData;
	}

	public void addCmNbAnchorGpsData(String anchorGspData) {
		this.cmNbAnchorGpsData.add(anchorGspData);
	}
	
	public int getActived() {
		return actived;
	}

	public void setActived(int actived) {
		this.actived = actived;
	}
	
	public boolean hasActivedData(){
		return this.actived != IS_CONF_INVALID;
	}

	// toString()...
	public String toString(){
		StringBuilder sb = new StringBuilder("actived=");
		sb.append(this.actived).append(";\n");
		if(this.gpsJsonDatas.size() > 0){
			sb.append("[GPS]: ");
			for(String s : this.gpsJsonDatas){
				sb.append(s).append(";\n");
			}
		}
		if(this.loraTerminalJsonDatas.size() > 0){
			sb.append("[LoRaTerminal]: ");
			for(String s : this.loraTerminalJsonDatas){
				sb.append(s).append(";\n");
			}
		}
		if(this.anchorJsonDatas.size() > 0){
			sb.append("[BT-Anchor]: ");
			for(String s : this.anchorJsonDatas){
				sb.append(s).append(";\n");
			}
		}
		if(this.beaconJsonDatas.size() > 0){
			sb.append("[BT-beacon]: ");
			for(String s : this.beaconJsonDatas){
				sb.append(s).append(";\n");
			}
		}
		return sb.toString();
	}

}
